<template>
  <dl>
    <dt>{{ $t('pageOverview.networkInformation') }}</dt>
    <dd></dd>
    <dt>{{ $t('pageOverview.hostName') }}：</dt>
    <dd v-if="network && network.hostname">
      {{ network.hostname ? network.hostname : '' }}
    </dd>
    <dt>{{ $t('pageOverview.linkStatus') }}：</dt>
    <dd v-if="network && network.linkStatus">
      {{ network.linkStatus ? network.linkStatus : '' }}
    </dd>
    <dt>IP：</dt>
    <dd>
      {{ URL }}
    </dd>
  </dl>
</template>

<script setup lang="ts">
import { useNetworkStore } from '@/store/Settings/NetworkStore';

const networkStore = useNetworkStore();
const network = computed(() => {
  return networkStore.globalNetworkSettings[1];
});
const URL = computed(() => {
  return window.location.hostname;
});

onMounted(() => {
  networkStore.getEthernetData();
});
</script>

<style lang="scss" scoped>
dl > dt:first-child {
  font-weight: bold;
  font-size: 16px;
  padding-bottom: 20px;
}
dl {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 10px;
  column-gap: 10px;
}
</style>
